﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class Crypter
   | FastReport OpenSource Class Reference </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class Crypter
   | FastReport OpenSource Class Reference ">
    <meta name="generator" content="docfx 2.45.1.0">
    
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../logo.png" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="FastReport.Utils.Crypter">
  
  
  <h1 id="FastReport_Utils_Crypter" data-uid="FastReport.Utils.Crypter" class="text-break">Class Crypter
  </h1>
  <div class="markdown level0 summary"><p>Contains methods used to crypt/decrypt a data.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><span class="xref">System.Object</span></div>
    <div class="level1"><span class="xref">Crypter</span></div>
  </div>
  <div class="inheritedMembers">
    <h5>Inherited Members</h5>
    <div>
      <span class="xref">System.Object.ToString()</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.GetHashCode()</span>
    </div>
    <div>
      <span class="xref">System.Object.GetType()</span>
    </div>
    <div>
      <span class="xref">System.Object.MemberwiseClone()</span>
    </div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="FastReport.Utils.html">FastReport.Utils</a></h6>
  <h6><strong>Assembly</strong>: FastReport.OpenSource.dll</h6>
  <h5 id="FastReport_Utils_Crypter_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static class Crypter</code></pre>
  </div>
  <h3 id="properties">Properties
  </h3>
  
  
  <a id="FastReport_Utils_Crypter_DefaultPassword_" data-uid="FastReport.Utils.Crypter.DefaultPassword*"></a>
  <h4 id="FastReport_Utils_Crypter_DefaultPassword" data-uid="FastReport.Utils.Crypter.DefaultPassword">DefaultPassword</h4>
  <div class="markdown level1 summary"><p>Sets the password that is used to crypt connection strings stored in a report.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static string DefaultPassword { set; }</code></pre>
  </div>
  <h5 class="propertyValue">Property Value</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <h5 id="FastReport_Utils_Crypter_DefaultPassword_remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>See the <a class="xref" href="FastReport.Data.DataConnectionBase.html#FastReport_Data_DataConnectionBase_ConnectionString">ConnectionString</a> property for more details.</p>
</div>
  <h3 id="methods">Methods
  </h3>
  
  
  <a id="FastReport_Utils_Crypter_ComputeHash_" data-uid="FastReport.Utils.Crypter.ComputeHash*"></a>
  <h4 id="FastReport_Utils_Crypter_ComputeHash_System_Byte___" data-uid="FastReport.Utils.Crypter.ComputeHash(System.Byte[])">ComputeHash(Byte[])</h4>
  <div class="markdown level1 summary"><p>Computes hash of specified array.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static string ComputeHash(byte[] input)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Byte</span>[]</td>
        <td><span class="parametername">input</span></td>
        <td><p>Initial array</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="FastReport_Utils_Crypter_ComputeHash_" data-uid="FastReport.Utils.Crypter.ComputeHash*"></a>
  <h4 id="FastReport_Utils_Crypter_ComputeHash_System_IO_Stream_" data-uid="FastReport.Utils.Crypter.ComputeHash(System.IO.Stream)">ComputeHash(Stream)</h4>
  <div class="markdown level1 summary"><p>Computes hash of specified stream. Initial position in stream will be saved.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static string ComputeHash(Stream input)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IO.Stream</span></td>
        <td><span class="parametername">input</span></td>
        <td><p>Initial stream</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="FastReport_Utils_Crypter_ComputeHash_" data-uid="FastReport.Utils.Crypter.ComputeHash*"></a>
  <h4 id="FastReport_Utils_Crypter_ComputeHash_System_String_" data-uid="FastReport.Utils.Crypter.ComputeHash(System.String)">ComputeHash(String)</h4>
  <div class="markdown level1 summary"><p>Computes hash of specified array.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static string ComputeHash(string input)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">input</span></td>
        <td><p>Initial array</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="FastReport_Utils_Crypter_Decrypt_" data-uid="FastReport.Utils.Crypter.Decrypt*"></a>
  <h4 id="FastReport_Utils_Crypter_Decrypt_System_IO_Stream_System_String_" data-uid="FastReport.Utils.Crypter.Decrypt(System.IO.Stream,System.String)">Decrypt(Stream, String)</h4>
  <div class="markdown level1 summary"><p>Decrypts a stream using specified password.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Stream Decrypt(Stream source, string password)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IO.Stream</span></td>
        <td><span class="parametername">source</span></td>
        <td><p>Stream that contains crypted data.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">password</span></td>
        <td><p>The password.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IO.Stream</span></td>
        <td><p>The stream that contains decrypted data.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="FastReport_Utils_Crypter_Decrypt_System_IO_Stream_System_String__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>You should read from the stream that this method returns.</p>
</div>
  
  
  <a id="FastReport_Utils_Crypter_DecryptString_" data-uid="FastReport.Utils.Crypter.DecryptString*"></a>
  <h4 id="FastReport_Utils_Crypter_DecryptString_System_String_" data-uid="FastReport.Utils.Crypter.DecryptString(System.String)">DecryptString(String)</h4>
  <div class="markdown level1 summary"><p>Decrypts the string using the default password.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static string DecryptString(string data)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">data</span></td>
        <td><p>String to decrypt.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><p>The decrypted string.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="FastReport_Utils_Crypter_DecryptString_System_String__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>The password used to decrypt a string can be set via <a class="xref" href="FastReport.Utils.Crypter.html#FastReport_Utils_Crypter_DefaultPassword">DefaultPassword</a> property.
You also may use the <a class="xref" href="FastReport.Utils.Crypter.html#FastReport_Utils_Crypter_DecryptString_System_String_System_String_">DecryptString(String, String)</a> method if you want to
specify another password.</p>
</div>
  
  
  <a id="FastReport_Utils_Crypter_DecryptString_" data-uid="FastReport.Utils.Crypter.DecryptString*"></a>
  <h4 id="FastReport_Utils_Crypter_DecryptString_System_String_System_String_" data-uid="FastReport.Utils.Crypter.DecryptString(System.String,System.String)">DecryptString(String, String)</h4>
  <div class="markdown level1 summary"><p>Decrypts the string using specified password.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static string DecryptString(string data, string password)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">data</span></td>
        <td><p>String to decrypt.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">password</span></td>
        <td><p>The password.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><p>The decrypted string.</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="FastReport_Utils_Crypter_Encrypt_" data-uid="FastReport.Utils.Crypter.Encrypt*"></a>
  <h4 id="FastReport_Utils_Crypter_Encrypt_System_IO_Stream_System_String_" data-uid="FastReport.Utils.Crypter.Encrypt(System.IO.Stream,System.String)">Encrypt(Stream, String)</h4>
  <div class="markdown level1 summary"><p>Crypts a stream using specified password.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Stream Encrypt(Stream dest, string password)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IO.Stream</span></td>
        <td><span class="parametername">dest</span></td>
        <td><p>The destination stream that will receive the crypted data.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">password</span></td>
        <td><p>The password.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IO.Stream</span></td>
        <td><p>The stream that you need to write to.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="FastReport_Utils_Crypter_Encrypt_System_IO_Stream_System_String__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>Pass the stream you need to write to, to the <strong>dest</strong> parameter. Write your data to the
stream that this method returns. When you close this stream, the <strong>dest</strong> stream will be
closed too and contains the crypted data.</p>
</div>
  
  
  <a id="FastReport_Utils_Crypter_EncryptString_" data-uid="FastReport.Utils.Crypter.EncryptString*"></a>
  <h4 id="FastReport_Utils_Crypter_EncryptString_System_String_" data-uid="FastReport.Utils.Crypter.EncryptString(System.String)">EncryptString(String)</h4>
  <div class="markdown level1 summary"><p>Encrypts the string using the default password.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static string EncryptString(string data)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">data</span></td>
        <td><p>String to encrypt.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><p>The encrypted string.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="FastReport_Utils_Crypter_EncryptString_System_String__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>The password used to encrypt a string can be set via <a class="xref" href="FastReport.Utils.Crypter.html#FastReport_Utils_Crypter_DefaultPassword">DefaultPassword</a> property.
You also may use the <a class="xref" href="FastReport.Utils.Crypter.html#FastReport_Utils_Crypter_EncryptString_System_String_System_String_">EncryptString(String, String)</a> method if you want to
specify another password.</p>
</div>
  
  
  <a id="FastReport_Utils_Crypter_EncryptString_" data-uid="FastReport.Utils.Crypter.EncryptString*"></a>
  <h4 id="FastReport_Utils_Crypter_EncryptString_System_String_System_String_" data-uid="FastReport.Utils.Crypter.EncryptString(System.String,System.String)">EncryptString(String, String)</h4>
  <div class="markdown level1 summary"><p>Encrypts the string using specified password.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static string EncryptString(string data, string password)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">data</span></td>
        <td><p>String to encrypt.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">password</span></td>
        <td><p>The password.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><p>The encrypted string.</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="FastReport_Utils_Crypter_IsStreamEncrypted_" data-uid="FastReport.Utils.Crypter.IsStreamEncrypted*"></a>
  <h4 id="FastReport_Utils_Crypter_IsStreamEncrypted_System_IO_Stream_" data-uid="FastReport.Utils.Crypter.IsStreamEncrypted(System.IO.Stream)">IsStreamEncrypted(Stream)</h4>
  <div class="markdown level1 summary"><p>Checks if the stream contains a crypt signature.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool IsStreamEncrypted(Stream stream)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IO.Stream</span></td>
        <td><span class="parametername">stream</span></td>
        <td><p>Stream to check.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p><strong>true</strong> if stream is crypted.</p>
</td>
      </tr>
    </tbody>
  </table>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            
            <span>Generated by <strong>DocFX</strong></span>
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
